<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>02_使用js创建虚拟DOM2</title>
</head>
<body>
  <script>
    function bsort(arr){
      var len = arr.length;
      for(var j = 0;i<len-1;j++){
         //相邻元素两两对比,大的元素交换到后面1
         if(arr[j] > arr[j+1]){
          var temp = arr[j]
         arr[j] = arr[j=1]
         arr[j+1] = temp
         }

      }
      return arr
    }
    // 举个数组
    myArr = [20,18,27,19,35]
    //使用函数
    bsort(myArr)
  </script>

</body>
</html>
